<!--音频播放-->
<template>
  <div>
    <vplayer ref="audioRef" :playerOptions="audioOption" />
  </div>
</template>

<script>
import { vplayer } from 'vue-hls-player'
export default {
  name: 'playVideoHls',
  components: { vplayer },
  data() {
    return {
      audioOption: {
        type: '',
        src: '',
        preload: true,
        autoplay: true,
        isLoop: false
      }
    }
  },
  methods: {
    // 播放
    playSource(playSrc) {
      this.audioOption.src = playSrc.sourceSrc
      this.audioOption.type = playSrc.sourceType
      this.$refs.audioRef.initMedia()
    },
    // 停止
    stopPlay() {
       this.$refs.audioRef.$refs.media.load()
    }
  }
}
</script>

<style></style>
